<?php

namespace app\common\model;

use app\common\model\Mail as MailModel;

/**
 * 文章模型
 * Class Article
 * @package app\common\model
 */
class Mail extends BaseModel
{
    protected $name = 'mail';
    /**
     * 新增记录
     * @param $data
     * @return bool
     * @throws \Exception
     */
    public function add($data)
    {
        $data['wxapp_id'] = self::$wxapp_id;
        return $this->allowField(true)->save($data);
    }
    public function addAll($data) {
        foreach($data as $k=>$v) {
            $data[$k]['wxapp_id'] = self::$wxapp_id;
        }

        return $this->allowField(true)->saveAll($data);
    }
}
